const ApiDef = require('./impl')
const kong_cfg = configure.get('kong')

class jwtService {
    constructor () {
        this.apiBaseUrl = kong_cfg.kong_admin
    }

    list (custom_id) {
        return ApiDef.get(`${this.apiBaseUrl}consumers/${custom_id}/jwt`)
    }

    delete (custom_id,jwt_id) {
        return ApiDef.delete(`${this.apiBaseUrl}consumers/${custom_id}/jwt/${jwt_id}`)
    }

    add (custom_id, data) {
        return ApiDef.post(`${this.apiBaseUrl}consumers/${custom_id}/jwt`, data)
    }
}

module.exports = new jwtService()

